package com.hospitalsystem.entity;

import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.Date;

public class MedicalRecordComparator implements Comparator<MedicalRecord> {
    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    @Override
    public int compare(MedicalRecord m1,MedicalRecord m2){
        Date date1 = m1.getTime();
        Date date2 = m2.getTime();
        return date1.compareTo(date2);
    }
}
